package study.designpattern.mediator;

import java.awt.event.ActionListener;

import javax.swing.JButton;

public class BtnBook extends JButton implements Command{
    IMediator med;
    
    public BtnBook(ActionListener al, IMediator med) {
        super("Book");
        this.med = med;
        addActionListener(al);
        med.registerBook(this);
    }

    @Override
    public void execute() {
        med.book();
    }

}
